{
	"info": {
		"_postman_id": "85d4ba54-c008-4582-b034-ec123c4b1d1b",
		"name": "Протокол 1.3 Изделия медицинского назначения",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "48020210",
		"_collection_link": "https://nst-sid-6186244.postman.co/workspace/nst-sid's-Workspace~d2a1dc8f-cae0-4166-807b-dc131f8f29a6/collection/48020210-85d4ba54-c008-4582-b034-ec123c4b1d1b?action=share&source=collection_link&creator=48020210"
	},
	"item": [
		{
			"name": "Предварительные условия",
			"item": [
				{
					"name": "Достать врача и организацию из токена врача и добавить в переменную",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"const jwt = pm.request.auth?.oauth2?.get(\"accessToken\") || pm.request.auth?.bearer?.get(\"token\") || null;\r",
									"console.log(jwt);\r",
									"if (jwt) {\r",
									"    let payload = jwt.split('.')[1];\r",
									"    payload = payload.replace(/-/g, '+').replace(/_/g, '/');\r",
									"    while (payload.length % 4) payload += '=';\r",
									"    let decoded = JSON.parse(atob(payload));\r",
									"    console.log(decoded)\r",
									"    let practitionerId = decoded.practitioner_id || decoded.practitionerId || decoded[\"practitioner_id\"];\r",
									"    let organizationId = decoded.organization_id || decoded.organizationId || decoded[\"organization_id\"];\r",
									"    if (practitionerId) pm.environment.set(\"PractitionerId\", practitionerId);\r",
									"    if (organizationId) pm.environment.set(\"OrganizationId\", organizationId);\r",
									"} else {\r",
									"    console.log(\"JWT токен не найден в переменных коллекции\");\r",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "0.3.4934",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": ""
						},
						"url": {
							"raw": "https://postman-echo.com/get",
							"protocol": "https",
							"host": [
								"postman-echo",
								"com"
							],
							"path": [
								"get"
							]
						}
					},
					"response": []
				},
				{
					"name": "Достать PractitionerRole врача (PractitionerRole)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
									"\r",
									"pm.environment.set(\"PractitionerRole\", practitionerRole);\r",
									"console.log(practitionerRole)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "practitioner",
									"value": "{{PractitionerId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Достать структурное подразделение врача (LocationId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"let json = pm.response.json();\r",
									"let locationValue = null;\r",
									"\r",
									"if (Array.isArray(json.entry)) {\r",
									"    for (let entry of json.entry) {\r",
									"        if (\r",
									"            entry.resource &&\r",
									"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
									"            Array.isArray(entry.resource.location) &&\r",
									"            entry.resource.location.length > 0\r",
									"        ) {\r",
									"            // Берём reference первого location и извлекаем только UUID\r",
									"            let ref = entry.resource.location[0].reference;\r",
									"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
									"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
									"            }\r",
									"            break;\r",
									"        }\r",
									"    }\r",
									"}\r",
									"\r",
									"if (locationValue) {\r",
									"    pm.environment.set(\"LocationId\", locationValue);\r",
									"    console.log(\"location сохранён:\", locationValue);\r",
									"} else {\r",
									"    console.log(\"location не найден\");\r",
									"}\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "_id",
									"value": "{{PractitionerRole}}"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "1. Назначение изделия медицинского назначения, созданное амбулаторно",
			"item": [
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551007A009PB4",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551007A009PB4"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleDeviceTest1\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3086\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-12-17T16:00:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionDeviceTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionDeviceTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/LOREncounter\"\r\n                },\r\n                \"date\": \"2025-12-17T16:00:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle по изделию медицинского назначения\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"DeviceRequest/DeviceOrder1Test\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleHearingLoss\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\",\r\n                                    \"display\": \"Уникальный идентификационный номер\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551007A009PB4\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 17.12.2025\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2025-12-17\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP2025017\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Самсонов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Игоревич\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"375297556655\"\r\n                    },\r\n                    {\r\n                        \"system\": \"email\",\r\n                        \"value\": \"test_mail@gmail.by\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"5170309411\",\r\n                                            \"display\": \"Улица Золотая Горка\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 29\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г.Минск, Улица Золотая Горка, д.5, кв.29\",\r\n                        \"postalCode\": \"220022\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"51703019678\",\r\n                                            \"display\": \"Проспект Рокоссовского\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 2\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г.Минск, Проспект Рокоссовского, д.20, кв.2\",\r\n                        \"postalCode\": \"220011\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"DeviceRequest/DeviceOrder1Test\",\r\n            \"resource\": {\r\n                \"resourceType\": \"DeviceRequest\",\r\n                \"id\": \"DeviceOrderTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceOrder\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/TermOfPurchaseMedication\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/TermOfPurchaseMedication\",\r\n                                    \"code\": \"0\",\r\n                                    \"display\": \"Бесплатно\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequestFromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"code\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicDeviceNomenclature\",\r\n                                \"code\": \"473\",\r\n                                \"display\": \"Аппарат слуховой аналоговый заушного типа для средних потерь слуха\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"quantity\": 1,\r\n                \"parameter\": [\r\n                    {\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                    \"code\": \"0e7cb0fa-4c8a-40e7-b9d4-628fd14dfc29\",\r\n                                    \"display\": \"Аппараты слуховые цифровые заушного и внутриушного типа для средних и тяжелых потерь слуха: Аппараты слуховые внутриушные серии Oticon OWN:\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/LOREncounter\"\r\n                },\r\n                \"occurrenceDateTime\": \"2026-01-05\",\r\n                \"authoredOn\": \"2025-12-17\",\r\n                \"requester\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                },\r\n                \"performer\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/IsHealthCareOrganization\",\r\n                                \"code\": \"health-care-organization\",\r\n                                \"display\": \"организация здравоохранения\"\r\n                            }\r\n                        ]\r\n                    },\r\n                    \"reference\": {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/IndicationsTechRehubDevice\",\r\n                                    \"code\": \"50.1.1\",\r\n                                    \"display\": \"двусторонняя хроническая тугоухость II, III, IV степени у взрослых\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ExampleHearingLoss\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ExampleHearingLoss\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Final\",\r\n                                    \"display\": \"Заключительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-12-17T16:00:00Z\"\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"H90.3\",\r\n                            \"display\": \"H90.3 - Нейросенсорная потеря слуха двусторонняя\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-12-17T16:00:00Z\",\r\n                \"recordedDate\": \"2025-12-17\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/LOREncounter\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"LOREncounter\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterConclusion\",\r\n                        \"valueString\": \"Требуется замена слухового аппарата\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"free\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"2025/17\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"primary\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-12-17T16:00:00Z\",\r\n                    \"end\": \"2025-12-17T16:15:00Z\"\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/EncounterReasons\",\r\n                                        \"code\": \"consult\",\r\n                                        \"display\": \"врачебная консультация\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ExampleHearingLoss\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Назначения изделия медицинского назначения",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DeviceRequest?_profile=https://fhir.by/StructureDefinition/DeviceOrder&patient={{patientId}}&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DeviceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceOrder"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "2. Отмена назначения медицинского изделия и назначение нового изделия",
			"item": [
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551007A009PB4",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551007A009PB4"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Назначения изделия медицинского назначения (DeviceRequestId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let deviceRequestId = jsonData.entry.find(obj => obj.resource.resourceType === \"DeviceRequest\").resource.id;\r",
									"\r",
									"pm.environment.set(\"DeviceRequestId\", deviceRequestId);\r",
									"console.log(deviceRequestId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DeviceRequest?_profile=https://fhir.by/StructureDefinition/DeviceOrder&patient={{patientId}}&_sort=-_lastUpdated&status=active",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DeviceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceOrder"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "status",
									"value": "active"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод поиска диагноза (ConditionId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
									"\r",
									"pm.environment.set(\"ConditionId\", conditionId);\r",
									"console.log(conditionId)"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&patient={{patientId}}&_sort=-_lastUpdated&code=H90.3",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"Condition"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "code",
									"value": "H90.3"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleCancellDeviceTest\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3086\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-12-18T16:00:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionCancellDeviceTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionCancellDeviceTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/LOREncounter2\"\r\n                },\r\n                \"date\": \"2025-12-18T16:00:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle по отмене изделия медицинского назначения\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Contract/ExampleCancellHearingAid\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"DeviceRequest/DeviceOrder13.2Test\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\",\r\n                                    \"display\": \"Уникальный идентификационный номер\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551007A009PB4\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 17.12.2025\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2025-12-17\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP2025017\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Самсонов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Игоревич\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"375297556655\"\r\n                    },\r\n                    {\r\n                        \"system\": \"email\",\r\n                        \"value\": \"test_mail@gmail.by\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"5170309411\",\r\n                                            \"display\": \"Улица Золотая Горка\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 29\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г.Минск, Улица Золотая Горка, д.5, кв.29\",\r\n                        \"postalCode\": \"220022\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"51703019678\",\r\n                                            \"display\": \"Проспект Рокоссовского\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 2\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г.Минск, Проспект Рокоссовского, д.20, кв.2\",\r\n                        \"postalCode\": \"220011\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Contract/ExampleCancellHearingAid\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Contract\",\r\n                \"id\": \"ExampleCancellHearingAid\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CancelOrder\"\r\n                    ]\r\n                },\r\n                \"expirationType\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/ReasonOfDrugCancelling\",\r\n                            \"code\": \"cancell-registration\",\r\n                            \"display\": \"Аннулирование (приостановка) регистрации лекарственного средства или изделия медицинского назначения\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"authority\": [\r\n                    {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"Отмена назначения изделия медицинского назначения\",\r\n                \"author\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                },\r\n                \"topicReference\": {\r\n                    \"reference\": \"DeviceRequest/{{DeviceRequestId}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Encounter/LOREncounter2\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Encounter\",\r\n                \"id\": \"LOREncounter2\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/EncounterGeneral\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterConclusion\",\r\n                        \"valueString\": \"Требуется замена слухового аппарата\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"free\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"2025/18\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"class\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                \"code\": \"1\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"priority\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/HealthCareForms\",\r\n                            \"code\": \"planned\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"primary\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"serviceProvider\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"actualPeriod\": {\r\n                    \"start\": \"2025-12-18T16:00:00Z\",\r\n                    \"end\": \"2025-12-18T16:15:00Z\"\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/EncounterReasons\",\r\n                                        \"code\": \"consult\",\r\n                                        \"display\": \"врачебная консультация\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/{{ConditionId}}\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": [\r\n                            {\r\n                                \"coding\": [\r\n                                    {\r\n                                        \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                        \"code\": \"mainDiagnosis\"\r\n                                    }\r\n                                ]\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"DeviceRequest/DeviceOrder13.2Test\",\r\n            \"resource\": {\r\n                \"resourceType\": \"DeviceRequest\",\r\n                \"id\": \"DeviceOrder13.2Test\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceOrder\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/TermOfPurchaseMedication\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/TermOfPurchaseMedication\",\r\n                                    \"code\": \"0\",\r\n                                    \"display\": \"Бесплатно\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/RequestFromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"intent\": \"plan\",\r\n                \"code\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicDeviceNomenclature\",\r\n                                \"code\": \"473\",\r\n                                \"display\": \"Аппарат слуховой аналоговый заушного типа для средних потерь слуха\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"quantity\": 1,\r\n                \"parameter\": [\r\n                    {\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                    \"code\": \"d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\",\r\n                                    \"display\": \"Аппараты слуховые цифровые заушного и внутриушного типа для средних и тяжелых потерь слуха: аппараты слуховые заушные серии Oticon Zircon:\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"encounter\": {\r\n                    \"reference\": \"Encounter/LOREncounter2\"\r\n                },\r\n                \"occurrenceDateTime\": \"2026-01-15\",\r\n                \"authoredOn\": \"2025-12-18\",\r\n                \"requester\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole}}\"\r\n                },\r\n                \"performer\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/IsHealthCareOrganization\",\r\n                                \"code\": \"health-care-organization\",\r\n                                \"display\": \"организация здравоохранения\"\r\n                            }\r\n                        ]\r\n                    },\r\n                    \"reference\": {\r\n                        \"reference\": \"Organization/{{OrganizationId}}\"\r\n                    }\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"reference\": {\r\n                            \"reference\": \"Condition/{{ConditionId}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Отмены назначения изделия медицинского назначения",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Contract?_profile=https://fhir.by/StructureDefinition/CancelOrder&patient={{patientId}}&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"Contract"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/CancelOrder"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Назначения изделия медицинского назначения",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DeviceRequest?_profile=https://fhir.by/StructureDefinition/DeviceOrder&patient={{patientId}}&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DeviceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceOrder"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "3. Факт обеспечения пациента изделием медицинского назначения",
			"item": [
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551007A009PB4",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551007A009PB4"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Назначения изделия медицинского назначения (DeviceRequestId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let deviceRequestId = jsonData.entry.find(obj => obj.resource.resourceType === \"DeviceRequest\").resource.id;\r",
									"\r",
									"pm.environment.set(\"DeviceRequestId\", deviceRequestId);\r",
									"console.log(deviceRequestId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DeviceRequest?_profile=https://fhir.by/StructureDefinition/DeviceOrder&patient={{patientId}}&_sort=-_lastUpdated&status=active",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DeviceRequest"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceOrder"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "status",
									"value": "active"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleDeviceTest3\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3086\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-12-19T16:00:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionDeviceTest13.3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionDeviceTest13.3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-12-19T16:00:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle по обеспечению изделием медицинского назначения\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Device/d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"DeviceDispense/ExampleDeviceDispense13.3\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\",\r\n                                    \"display\": \"Уникальный идентификационный номер\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551007A009PB4\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 17.12.2025\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2025-12-17\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP2025017\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Самсонов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Игоревич\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"375297556655\"\r\n                    },\r\n                    {\r\n                        \"system\": \"email\",\r\n                        \"value\": \"test_mail@gmail.by\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"5170309411\",\r\n                                            \"display\": \"Улица Золотая Горка\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 29\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г.Минск, Улица Золотая Горка, д.5, кв.29\",\r\n                        \"postalCode\": \"220022\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"51703019678\",\r\n                                            \"display\": \"Проспект Рокоссовского\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 2\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г.Минск, Проспект Рокоссовского, д.20, кв.2\",\r\n                        \"postalCode\": \"220011\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Device/d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Device\",\r\n                \"id\": \"d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceForPatient\"\r\n                    ]\r\n                },\r\n                \"displayName\": \"Аппарат слуховой заушного типа для средней тяжести потери слуха\",\r\n                \"definition\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                \"code\": \"d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\",\r\n                                \"display\": \"Аппараты слуховые цифровые заушного и внутриушного типа для средних и тяжелых потерь слуха: аппараты слуховые заушные серии Oticon Zircon:\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"manufactureDate\": \"2025-03-02\",\r\n                \"serialNumber\": \"AA11223390\",\r\n                \"modelNumber\": \"Oticon Zircon 1\",\r\n                \"owner\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"DeviceDispense/ExampleDeviceDispense13.3\",\r\n            \"resource\": {\r\n                \"resourceType\": \"DeviceDispense\",\r\n                \"id\": \"ExampleDeviceDispense13.3\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DevicePatientDispenseBy\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DeviceServiceLife\",\r\n                        \"valueDate\": \"2026-12-10\"\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"2025/1\"\r\n                    }\r\n                ],\r\n                \"basedOn\": [\r\n                    {\r\n                        \"reference\": \"DeviceRequest/{{DeviceRequestId}}\"\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"device\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicDeviceNomenclature\",\r\n                                \"code\": \"473\",\r\n                                \"display\": \"Аппарат слуховой аналоговый заушного типа для средних потерь слуха\"\r\n                            }\r\n                        ]\r\n                    },\r\n                    \"reference\": {\r\n                        \"reference\": \"Device/d1f1c98a-d24a-4fef-beb0-05b5004c4cb6\"\r\n                    }\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"receiver\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"performer\": [\r\n                    {\r\n                        \"function\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/IsHealthCareOrganization\",\r\n                                    \"code\": \"health-care-organization\",\r\n                                    \"display\": \"организация здравоохранения\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"actor\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/TermOfPurchaseMedication\",\r\n                            \"code\": \"0\",\r\n                            \"display\": \"Бесплатно\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"quantity\": {\r\n                    \"value\": 1\r\n                },\r\n                \"whenHandedOver\": \"2025-12-19\",\r\n                \"usageInstruction\": \"Как включить слуховой аппарат\"\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Изделия МН, которым был обеспечен пациент",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Organization/{{OrganizationId}}/Device?_profile=https://fhir.by/StructureDefinition/DeviceForPatient&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Organization",
								"{{OrganizationId}}",
								"Device"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceForPatient"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Факта обеспечения пациента изделием МН",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/DeviceDispense?_profile=https://fhir.by/StructureDefinition/DevicePatientDispenseBy&patient={{patientId}}&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"DeviceDispense"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DevicePatientDispenseBy"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "4. Обеспечение изделием медицинского назначения, созданное в условиях стационара",
			"item": [
				{
					"name": "Достать PractitionerRole врача приемного отделения (PractitionerRole_EmergencyRoom)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
									"\r",
									"pm.environment.set(\"PractitionerRole_EmergencyRoom\", practitionerRole);\r",
									"console.log(practitionerRole)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?practitioner={{PractitionerId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "practitioner",
									"value": "{{PractitionerId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Достать PractitionerRole врача-хирурга (PractitionerRole_surgeon)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
									"\r",
									"pm.environment.set(\"PractitionerRole_surgeon\", practitionerRole);\r",
									"console.log(practitionerRole)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?position-type=surgeon&practitioner={{PractitionerId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "position-type",
									"value": "surgeon"
								},
								{
									"key": "practitioner",
									"value": "{{PractitionerId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Достать Location врача-хирурга (LocationId_surgeon)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"let json = pm.response.json();\r",
									"let locationValue = null;\r",
									"\r",
									"if (Array.isArray(json.entry)) {\r",
									"    for (let entry of json.entry) {\r",
									"        if (\r",
									"            entry.resource &&\r",
									"            entry.resource.resourceType === \"PractitionerRole\" &&\r",
									"            Array.isArray(entry.resource.location) &&\r",
									"            entry.resource.location.length > 0\r",
									"        ) {\r",
									"            // Берём reference первого location и извлекаем только UUID\r",
									"            let ref = entry.resource.location[0].reference;\r",
									"            if (typeof ref === \"string\" && ref.startsWith(\"Location/\")) {\r",
									"                locationValue = ref.split(\"/\")[1]; // или: ref.replace(\"Location/\", \"\")\r",
									"            }\r",
									"            break;\r",
									"        }\r",
									"    }\r",
									"}\r",
									"\r",
									"if (locationValue) {\r",
									"    pm.environment.set(\"LocationId_surgeon\", locationValue);\r",
									"    console.log(\"location сохранён:\", locationValue);\r",
									"} else {\r",
									"    console.log(\"location не найден\");\r",
									"}\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?_id={{PractitionerRole_surgeon}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "_id",
									"value": "{{PractitionerRole_surgeon}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск пациента по идентификатору (patientId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let patientId = jsonData.entry.find(obj => obj.resource.resourceType === \"Patient\").resource.id;\r",
									"\r",
									"pm.environment.set(\"patientId\", patientId);\r",
									"console.log(patientId)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient?identifier=7551007A009PB4",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient"
							],
							"query": [
								{
									"key": "identifier",
									"value": "7551007A009PB4"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Создание активной госпитализации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BBundleDeviceTest4.1\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3086\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-12-20T16:00:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionSurgery1Test\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionSurgery1Test\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-12-20T16:00:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle по оперативному вмешательству\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ConditionPreliminaryTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"EpisodeOfCare/ExampleHospitalisation3.1Test\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\",\r\n                                    \"display\": \"Уникальный идентификационный номер\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551007A009PB4\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 17.12.2025\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2025-12-17\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP2025017\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Самсонов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Игоревич\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"375297556655\"\r\n                    },\r\n                    {\r\n                        \"system\": \"email\",\r\n                        \"value\": \"test_mail@gmail.by\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"5170309411\",\r\n                                            \"display\": \"Улица Золотая Горка\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 29\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г.Минск, Улица Золотая Горка, д.5, кв.29\",\r\n                        \"postalCode\": \"220022\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"51703019678\",\r\n                                            \"display\": \"Проспект Рокоссовского\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 2\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г.Минск, Проспект Рокоссовского, д.20, кв.2\",\r\n                        \"postalCode\": \"220011\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"EpisodeOfCare/ExampleHospitalisation3.1Test\",\r\n            \"resource\": {\r\n                \"resourceType\": \"EpisodeOfCare\",\r\n                \"id\": \"ExampleHospitalisation3.1Test\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/Hospitalisation\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaidType\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/HospitalisationPaidType\",\r\n                                            \"code\": \"govern\",\r\n                                            \"display\": \"за счет бюджетных средств\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaid\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EmergencyHospitalisationTerm\",\r\n                        \"valuePositiveInt\": 6\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HepatitisBool\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DiagnosisOfSendingOrganisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Condition/ConditionPreliminaryTest\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SequenceNumbeHospitalisation\",\r\n                        \"valuePositiveInt\": 1\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"1/1\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"active\",\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"special\",\r\n                                \"display\": \"Специализированная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/HospitalisationReasonUse\",\r\n                                    \"code\": \"2\",\r\n                                    \"display\": \"Экстренная госпитализация\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": [\r\n                            {\r\n                                \"concept\": {\r\n                                    \"text\": \"Для уточнения диагноза и лечения\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/ConditionPreliminaryTest\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\",\r\n                                    \"display\": \"Предварительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"managingOrganization\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"period\": {\r\n                    \"start\": \"2025-12-20\"\r\n                },\r\n                \"careManager\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/ConditionPreliminaryTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"ConditionPreliminaryTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-12-20T10:12:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/CourseOfDisease\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/CourseOfDisease\",\r\n                                    \"code\": \"acute\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M16.0\",\r\n                            \"display\": \"M16.0 - Первичный коксартроз двусторонний\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-12-20\",\r\n                \"recordedDate\": \"2025-12-20\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"Предварительный диагноз Первичный коксартроз ?\"\r\n                    }\r\n                ]\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод поиска активного случая Госпитализации (startEpisodeOfCareId)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let episodeOfCaretId = jsonData.entry.find(obj => obj.resource.resourceType === \"EpisodeOfCare\").resource.id;\r",
									"\r",
									"pm.environment.set(\"startEpisodeOfCareId\", episodeOfCaretId);\r",
									"console.log(episodeOfCaretId)"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/EpisodeOfCare?_profile=https://fhir.by/StructureDefinition/Hospitalisation&patient={{patientId}}&_sort=-_lastUpdated&status=active",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"EpisodeOfCare"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/Hospitalisation"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "status",
									"value": "active"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод поиска Предварительного диагноза (preliminaryCondition)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let conditionId = jsonData.entry.find(obj => obj.resource.resourceType === \"Condition\").resource.id;\r",
									"\r",
									"pm.environment.set(\"preliminaryCondition\", conditionId);\r",
									"console.log(conditionId)"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/Condition?_profile=https://fhir.by/StructureDefinition/FinalDiagnosis&patient={{patientId}}&_sort=-_lastUpdated&code=M16.0",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"Condition"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/FinalDiagnosis"
								},
								{
									"key": "patient",
									"value": "{{patientId}}"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								},
								{
									"key": "code",
									"value": "M16.0"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск PractitionerRole медсестры (PractitionerRole_sister)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
									"\r",
									"pm.environment.set(\"PractitionerRole_sister\", practitionerRole);\r",
									"console.log(practitionerRole)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?position-type=surgical-nurse-senior&organization={{OrganizationId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "position-type",
									"value": "surgical-nurse-senior"
								},
								{
									"key": "organization",
									"value": "{{OrganizationId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Поиск PractitionerRole врача-реаниматолога (PractitionerRole_resuscitator)",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"var jsonData = pm.response.json();\r",
									"let practitionerRole = jsonData.entry.find(obj => obj.resource.resourceType === \"PractitionerRole\").resource.id;\r",
									"\r",
									"pm.environment.set(\"PractitionerRole_resuscitator\", practitionerRole);\r",
									"console.log(practitionerRole)\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/PractitionerRole?position-type=anesthesiologist-resuscitator&organization={{OrganizationId}}",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"PractitionerRole"
							],
							"query": [
								{
									"key": "position-type",
									"value": "anesthesiologist-resuscitator"
								},
								{
									"key": "organization",
									"value": "{{OrganizationId}}"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод импорта пакета медицинской информации",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Валидный бандл должен отработать со статусом 202\", function () {\r",
									"    pm.response.to.have.status(202);\r",
									"});\r",
									"\r",
									"var jsonData = pm.response.json();\r",
									"let bundleId = jsonData.parameter.find(obj => obj.name === \"ResourceId\").valueString;\r",
									"let statusReference = jsonData.parameter.find(obj => obj.name === \"OperationStatusReference\");\r",
									"\r",
									"console.log(statusReference.valueReference.reference);\r",
									"\r",
									"pm.collectionVariables.set(\"bundleId\", bundleId);\r",
									"pm.collectionVariables.set(\"StatusUrl\", statusReference.valueReference.reference);\r",
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-Fhir-By-Version",
								"value": "active",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"resourceType\": \"Bundle\",\r\n    \"id\": \"BundleDeviceTest4.2\",\r\n    \"meta\": {\r\n        \"profile\": [\r\n            \"https://fhir.by/AbstractArea/StructureDefinition/Bundle/MedicationDocument\"\r\n        ]\r\n    },\r\n    \"identifier\": {\r\n        \"system\": \"https://fhir.by/ValueSet/urn:ietf:rfc:3086\",\r\n        \"value\": \"{{$guid}}\"\r\n    },\r\n    \"type\": \"document\",\r\n    \"timestamp\": \"2025-12-20T17:00:00Z\",\r\n    \"entry\": [\r\n        {\r\n            \"fullUrl\": \"Composition/CompositionDeviceTest4.2\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Composition\",\r\n                \"id\": \"CompositionDeviceTest4.2\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/CompDocument\"\r\n                    ]\r\n                },\r\n                \"status\": \"final\",\r\n                \"type\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/CompositionType\",\r\n                            \"code\": \"general\",\r\n                            \"display\": \"Общая медицинская информация\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": [\r\n                    {\r\n                        \"reference\": \"Patient/PatientTest\"\r\n                    }\r\n                ],\r\n                \"date\": \"2025-12-20T17:00:00Z\",\r\n                \"author\": [\r\n                    {\r\n                        \"reference\": \"Practitioner/{{PractitionerId}}\"\r\n                    }\r\n                ],\r\n                \"title\": \"CompDocument для наполненного Bundle Обеспечению изделием медицинского назначения\",\r\n                \"custodian\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"event\": [\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Procedure/EndoprostheticsTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"EpisodeOfCare/ExampleHospitalisation4.2Test\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/CoxarthrosisFinalTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/CoxarthrosisClinicalTest\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Device/5126e948-f039-479d-b0a6-776b8ac789c4\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Device/6323a5bb-dc41-4b99-8c32-7f19c5eea4d1\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    },\r\n                    {\r\n                        \"detail\": [\r\n                            {\r\n                                \"reference\": {\r\n                                    \"reference\": \"Device/128f9a3a-7e78-47ae-8b22-d9fd2a267629\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Patient/PatientTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Patient\",\r\n                \"id\": \"PatientTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/PatientWithIdentificationNumber\"\r\n                    ]\r\n                },\r\n                \"identifier\": [\r\n                    {\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"INP\",\r\n                                    \"display\": \"Уникальный идентификационный номер\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"7551007A009PB4\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedString\",\r\n                                        \"valueString\": \"Центральным РУВД г Минска, 17.12.2025\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedDate\",\r\n                                        \"valueDate\": \"2025-12-17\"\r\n                                    },\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/PassportIssuedCode\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/OCAM\",\r\n                                                    \"code\": \"710\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"url\": \"https://fhir.by/StructureDefinition/PassportIssued\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"usual\",\r\n                        \"type\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/PersonalDocumentType\",\r\n                                    \"code\": \"Passport-RB\",\r\n                                    \"display\": \"Паспорт гражданина Республики Беларусь\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": \"MP2025017\"\r\n                    }\r\n                ],\r\n                \"active\": true,\r\n                \"name\": [\r\n                    {\r\n                        \"family\": \"Самсонов\",\r\n                        \"given\": [\r\n                            \"Петр\",\r\n                            \"Игоревич\"\r\n                        ]\r\n                    }\r\n                ],\r\n                \"telecom\": [\r\n                    {\r\n                        \"system\": \"phone\",\r\n                        \"value\": \"375297556655\"\r\n                    },\r\n                    {\r\n                        \"system\": \"email\",\r\n                        \"value\": \"test_mail@gmail.by\"\r\n                    }\r\n                ],\r\n                \"gender\": \"male\",\r\n                \"birthDate\": \"1990-12-31\",\r\n                \"deceasedBoolean\": false,\r\n                \"address\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"5170309411\",\r\n                                            \"display\": \"Улица Золотая Горка\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 29\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"home\",\r\n                        \"text\": \"г.Минск, Улица Золотая Горка, д.5, кв.29\",\r\n                        \"postalCode\": \"220022\"\r\n                    },\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/CoutryForAddresses\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/CitizenshipCode\",\r\n                                            \"code\": \"BY\",\r\n                                            \"display\": \"Беларусь\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/StreetGeoRegistry\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/StreetGeoRegistry\",\r\n                                            \"code\": \"51703019678\",\r\n                                            \"display\": \"Проспект Рокоссовского\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            },\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/ApartmentRoom\",\r\n                                \"valueString\": \"кв. 2\"\r\n                            }\r\n                        ],\r\n                        \"use\": \"temp\",\r\n                        \"text\": \"г.Минск, Проспект Рокоссовского, д.20, кв.2\",\r\n                        \"postalCode\": \"220011\"\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"EpisodeOfCare/ExampleHospitalisation4.2Test\",\r\n            \"resource\": {\r\n                \"resourceType\": \"EpisodeOfCare\",\r\n                \"id\": \"ExampleHospitalisation4.2Test\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/Hospitalisation\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"extension\": [\r\n                            {\r\n                                \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaidType\",\r\n                                \"valueCodeableConcept\": {\r\n                                    \"coding\": [\r\n                                        {\r\n                                            \"system\": \"https://fhir.by/ValueSet/HospitalisationPaidType\",\r\n                                            \"code\": \"govern\",\r\n                                            \"display\": \"за счет бюджетных средств\"\r\n                                        }\r\n                                    ]\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HospitalisationPaid\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EmergencyHospitalisationTerm\",\r\n                        \"valuePositiveInt\": 6\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/HepatitisBool\",\r\n                        \"valueBoolean\": false\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/DiagnosisOfSendingOrganisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Condition/{{preliminaryCondition}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/SequenceNumbeHospitalisation\",\r\n                        \"valuePositiveInt\": 1\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/PreviusResourceHospitalisation\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"EpisodeOfCare/{{startEpisodeOfCareId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"12/1\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"waitlist\",\r\n                \"type\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/TypeOfHealthCare\",\r\n                                \"code\": \"hightechnology\",\r\n                                \"display\": \"Высокотехнологичная медицинская помощь\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"reason\": [\r\n                    {\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/HospitalisationReasonUse\",\r\n                                    \"code\": \"2\",\r\n                                    \"display\": \"Экстренная госпитализация\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"value\": [\r\n                            {\r\n                                \"concept\": {\r\n                                    \"text\": \"Для уточнения диагноза и лечения\"\r\n                                }\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"diagnosis\": [\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/{{preliminaryCondition}}\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Preliminary\",\r\n                                    \"display\": \"Предварительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/CoxarthrosisClinicalTest\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Clinical\",\r\n                                    \"display\": \"Клинический диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"condition\": [\r\n                            {\r\n                                \"extension\": [\r\n                                    {\r\n                                        \"url\": \"https://fhir.by/StructureDefinition/TypeOfDiagnosis\",\r\n                                        \"valueCodeableConcept\": {\r\n                                            \"coding\": [\r\n                                                {\r\n                                                    \"system\": \"https://fhir.by/ValueSet/TypeOfDiagnosis\",\r\n                                                    \"code\": \"mainDiagnosis\",\r\n                                                    \"display\": \"Основной диагноз\"\r\n                                                }\r\n                                            ]\r\n                                        }\r\n                                    }\r\n                                ],\r\n                                \"reference\": {\r\n                                    \"reference\": \"Condition/CoxarthrosisFinalTest\"\r\n                                }\r\n                            }\r\n                        ],\r\n                        \"use\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Final\",\r\n                                    \"display\": \"Заключительный диагноз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"patient\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"managingOrganization\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                },\r\n                \"period\": {\r\n                    \"start\": \"2025-12-20\",\r\n                    \"end\": \"2025-12-20\"\r\n                },\r\n                \"careManager\": {\r\n                    \"reference\": \"PractitionerRole/{{PractitionerRole_EmergencyRoom}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/CoxarthrosisFinalTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"CoxarthrosisFinalTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Final\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-12-20T14:15:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M16.0\",\r\n                            \"display\": \"M16.0 - Первичный коксартроз двусторонний\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-12-20\",\r\n                \"recordedDate\": \"2025-12-20\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_surgeon}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Condition/CoxarthrosisClinicalTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Condition\",\r\n                \"id\": \"CoxarthrosisClinicalTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/FinalDiagnosis\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/KindOfDiagnosis\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/KindOfDiagnosisCode\",\r\n                                    \"code\": \"Clinical\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AssertedDate\",\r\n                        \"valueDateTime\": \"2025-12-20T14:15:00Z\"\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FirstTimeRevealed\",\r\n                        \"valueBoolean\": true\r\n                    }\r\n                ],\r\n                \"clinicalStatus\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"http://terminology.hl7.org/CodeSystem/condition-clinical\",\r\n                            \"code\": \"active\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/InternClassificDiseases10\",\r\n                            \"code\": \"M16.0\",\r\n                            \"display\": \"M16.0 - Первичный коксартроз двусторонний\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"onsetDateTime\": \"2025-12-20\",\r\n                \"recordedDate\": \"2025-12-20\",\r\n                \"participant\": [\r\n                    {\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_surgeon}}\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Procedure/EndoprostheticsTest\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Procedure\",\r\n                \"id\": \"EndoprostheticsTest\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/SurgicalProcedure\"\r\n                    ]\r\n                },\r\n                \"extension\": [\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/FromOrganization\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/EncounterTypeOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/EncounterTypeOfService\",\r\n                                    \"code\": \"paid\",\r\n                                    \"display\": \"Платные услуги\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/TermsOfService\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/VSTermsOfService\",\r\n                                    \"code\": \"2\",\r\n                                    \"display\": \"стационарные\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/InpatientMedicalRecord\",\r\n                        \"valueReference\": {\r\n                            \"reference\": \"EpisodeOfCare/{{startEpisodeOfCareId}}\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/AnesthesiaType\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/AnesthesiaType\",\r\n                                    \"code\": \"endotracheal\",\r\n                                    \"display\": \"Эндотрахеальный наркоз\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProcedureComplexity\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProcedureComplexity\",\r\n                                    \"code\": \"high-tech\",\r\n                                    \"display\": \"Высокотехнологичное\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    },\r\n                    {\r\n                        \"url\": \"https://fhir.by/StructureDefinition/ProcedureUrgency\",\r\n                        \"valueCodeableConcept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/ProcedureUrgency\",\r\n                                    \"code\": \"planned\",\r\n                                    \"display\": \"Плановое\"\r\n                                }\r\n                            ]\r\n                        }\r\n                    }\r\n                ],\r\n                \"identifier\": [\r\n                    {\r\n                        \"value\": \"13580\",\r\n                        \"assigner\": {\r\n                            \"reference\": \"Organization/{{OrganizationId}}\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"status\": \"completed\",\r\n                \"category\": [\r\n                    {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/ProcedureType\",\r\n                                \"code\": \"reconstructive\",\r\n                                \"display\": \"Реконструктивная\"\r\n                            }\r\n                        ]\r\n                    }\r\n                ],\r\n                \"code\": {\r\n                    \"coding\": [\r\n                        {\r\n                            \"system\": \"https://fhir.by/ValueSet/SurgicalInterventions\",\r\n                            \"code\": \"NFSB30\",\r\n                            \"display\": \"Первичное тотальное протезирование тазобедренного сустава по гибридной методике\"\r\n                        }\r\n                    ],\r\n                    \"text\": \"Первичное тотальное протезирование тазобедренного сустава по гибридной методике\"\r\n                },\r\n                \"subject\": {\r\n                    \"reference\": \"Patient/PatientTest\"\r\n                },\r\n                \"occurrencePeriod\": {\r\n                    \"start\": \"2025-12-20T12:00:00Z\",\r\n                    \"end\": \"2025-12-20T14:20:00Z\"\r\n                },\r\n                \"performer\": [\r\n                    {\r\n                        \"function\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/OperatingTeam\",\r\n                                    \"code\": \"operator\",\r\n                                    \"display\": \"врач-хирург оперирующий\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_surgeon}}\"\r\n                        },\r\n                        \"period\": {\r\n                            \"start\": \"2025-12-20T12:00:00Z\",\r\n                            \"end\": \"2025-12-20T13:40:00Z\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"function\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/OperatingTeam\",\r\n                                    \"code\": \"surgical-sister\",\r\n                                    \"display\": \"медицинская сестра операционная\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_sister}}\"\r\n                        },\r\n                        \"period\": {\r\n                            \"start\": \"2025-12-20T12:00:00Z\",\r\n                            \"end\": \"2025-12-20T14:20:00Z\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"function\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/OperatingTeam\",\r\n                                    \"code\": \"anesthetist\",\r\n                                    \"display\": \"врач-анестезиолог-реаниматолог\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"actor\": {\r\n                            \"reference\": \"PractitionerRole/{{PractitionerRole_resuscitator}}\"\r\n                        },\r\n                        \"period\": {\r\n                            \"start\": \"2025-12-20T12:00:00Z\",\r\n                            \"end\": \"2025-12-20T14:20:00Z\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"location\": {\r\n                    \"reference\": \"Location/{{LocationId_surgeon}}\"\r\n                },\r\n                \"reason\": [\r\n                    {\r\n                        \"concept\": {\r\n                            \"coding\": [\r\n                                {\r\n                                    \"system\": \"https://fhir.by/ValueSet/SurgicalInterventionDiagnosis\",\r\n                                    \"code\": \"postoperative\",\r\n                                    \"display\": \"Диагноз после вмешательства\"\r\n                                }\r\n                            ]\r\n                        },\r\n                        \"reference\": {\r\n                            \"reference\": \"Condition/CoxarthrosisFinalTest\"\r\n                        }\r\n                    }\r\n                ],\r\n                \"note\": [\r\n                    {\r\n                        \"text\": \"После обработки операционного поля выполнен доступ к тазобедренному суставу. Обработка вертлужной впадины \\nУдаление поврежденной головки бедренной кости и части вертлужной впадины. Обработка вертлужной впадины сферическими фрезами,  установка металлического и полиэтиленового компонентов чаши эндопротеза.\\nОбработка бедренной кости риммерами, установка ножки в канал бедренной кости. Установка головки (сферического компонента) на ножку. \\nСоединение головки с чашей протеза. Оценка двигательной функции сустава. Послойное ушивание раны. Асептическая повязка.\\nКровопотеря - около 200 мл. Осложнений во время операции не отмечено.\"\r\n                    }\r\n                ],\r\n                \"focalDevice\": [\r\n                    {\r\n                        \"manipulated\": {\r\n                            \"reference\": \"Device/5126e948-f039-479d-b0a6-776b8ac789c4\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"manipulated\": {\r\n                            \"reference\": \"Device/6323a5bb-dc41-4b99-8c32-7f19c5eea4d1\"\r\n                        }\r\n                    },\r\n                    {\r\n                        \"manipulated\": {\r\n                            \"reference\": \"Device/128f9a3a-7e78-47ae-8b22-d9fd2a267629\"\r\n                        }\r\n                    }\r\n                ]\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Device/5126e948-f039-479d-b0a6-776b8ac789c4\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Device\",\r\n                \"id\": \"5126e948-f039-479d-b0a6-776b8ac789c4\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceForPatient\"\r\n                    ]\r\n                },\r\n                \"displayName\": \"Эндопротез тазобедренного сустава: головка\",\r\n                \"definition\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                \"code\": \"5126e948-f039-479d-b0a6-776b8ac789c4\",\r\n                                \"display\": \"Эндопротез тазобедренного сустава: компоненты эндопротеза тазобедренного сустава: головка керамическая Biolox Delta Ceramic Femoral Head (DELTA CER HEAD),\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"manufactureDate\": \"2025-03-02\",\r\n                \"serialNumber\": \"AA11223399\",\r\n                \"modelNumber\": \"DELTA CER HEAD\",\r\n                \"owner\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Device/6323a5bb-dc41-4b99-8c32-7f19c5eea4d1\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Device\",\r\n                \"id\": \"6323a5bb-dc41-4b99-8c32-7f19c5eea4d1\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceForPatient\"\r\n                    ]\r\n                },\r\n                \"displayName\": \"Эндопротез тазобедренного сустава: ножка\",\r\n                \"definition\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                \"code\": \"6323a5bb-dc41-4b99-8c32-7f19c5eea4d1\",\r\n                                \"display\": \"Эндопротез тазобедренного сустава: ножка цементная бедренная Corail,\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"manufactureDate\": \"2025-03-10\",\r\n                \"serialNumber\": \"AA11223377\",\r\n                \"modelNumber\": \"Corail\",\r\n                \"owner\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                }\r\n            }\r\n        },\r\n        {\r\n            \"fullUrl\": \"Device/128f9a3a-7e78-47ae-8b22-d9fd2a267629\",\r\n            \"resource\": {\r\n                \"resourceType\": \"Device\",\r\n                \"id\": \"128f9a3a-7e78-47ae-8b22-d9fd2a267629\",\r\n                \"meta\": {\r\n                    \"profile\": [\r\n                        \"https://fhir.by/StructureDefinition/DeviceForPatient\"\r\n                    ]\r\n                },\r\n                \"displayName\": \"Эндопротез тазобедренного сустава: чашка\",\r\n                \"definition\": {\r\n                    \"concept\": {\r\n                        \"coding\": [\r\n                            {\r\n                                \"system\": \"https://fhir.by/ValueSet/MedicalProducts\",\r\n                                \"code\": \"128f9a3a-7e78-47ae-8b22-d9fd2a267629\",\r\n                                \"display\": \"Эндопротез тазобедренного сустава:чашка,\"\r\n                            }\r\n                        ]\r\n                    }\r\n                },\r\n                \"manufactureDate\": \"2025-06-02\",\r\n                \"serialNumber\": \"AA11223366\",\r\n                \"modelNumber\": \"PINNACLE\",\r\n                \"owner\": {\r\n                    \"reference\": \"Organization/{{OrganizationId}}\"\r\n                }\r\n            }\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/$import",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"$import"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод получения статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				},
				{
					"name": "Метод проверки наличия Изделий МН, которыми был обеспечен пациент",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Organization/{{OrganizationId}}/Device?_profile=https://fhir.by/StructureDefinition/DeviceForPatient&_sort=-_lastUpdated",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Organization",
								"{{OrganizationId}}",
								"Device"
							],
							"query": [
								{
									"key": "_profile",
									"value": "https://fhir.by/StructureDefinition/DeviceForPatient"
								},
								{
									"key": "_sort",
									"value": "-_lastUpdated"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение сводной информации о пациенте",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Patient/{{patientId}}/$everything?start=2025-10&end=2025-12",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Patient",
								"{{patientId}}",
								"$everything"
							],
							"query": [
								{
									"key": "start",
									"value": "2025-10"
								},
								{
									"key": "end",
									"value": "2025-12"
								}
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Отмена импорта медицинской информации",
			"item": [
				{
					"name": "Отмена импорта медицинской информации",
					"request": {
						"method": "POST",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$cancel",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$cancel"
							]
						}
					},
					"response": []
				},
				{
					"name": "Получение статуса импорта пакета медицинской информации",
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "https://pp.cisz.by/api/fhir/Bundle/{{bundleId}}/$status",
							"protocol": "https",
							"host": [
								"pp",
								"cisz",
								"by"
							],
							"path": [
								"api",
								"fhir",
								"Bundle",
								"{{bundleId}}",
								"$status"
							]
						}
					},
					"response": []
				}
			]
		}
	],
	"auth": {
		"type": "oauth2",
		"oauth2": [
			{
				"key": "useBrowser",
				"value": true,
				"type": "boolean"
			},
			{
				"key": "redirect_uri",
				"value": "https://oauth.pstmn.io/v1/callback",
				"type": "string"
			},
			{
				"key": "clientId",
				"value": "mis_agsr_web_application",
				"type": "string"
			},
			{
				"key": "tokenRequestParams",
				"value": [
					{
						"key": "origin",
						"value": "https://oauth.pstmn.io/v1/callback",
						"enabled": true,
						"send_as": "request_header"
					}
				],
				"type": "any"
			},
			{
				"key": "scope",
				"value": "profile email acr realm roles",
				"type": "string"
			},
			{
				"key": "accessTokenUrl",
				"value": "https://pp.cisz.by/auth/api/realms/iehr/token",
				"type": "string"
			},
			{
				"key": "authUrl",
				"value": "https://pp.cisz.by/auth/api/realms/iehr/auth",
				"type": "string"
			},
			{
				"key": "clientSecret",
				"value": "",
				"type": "string"
			},
			{
				"key": "grant_type",
				"value": "authorization_code_with_pkce",
				"type": "string"
			},
			{
				"key": "refreshRequestParams",
				"value": [],
				"type": "any"
			},
			{
				"key": "authRequestParams",
				"value": [],
				"type": "any"
			},
			{
				"key": "challengeAlgorithm",
				"value": "S256",
				"type": "string"
			},
			{
				"key": "addTokenTo",
				"value": "header",
				"type": "string"
			},
			{
				"key": "client_authentication",
				"value": "body",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "practitioner_id",
			"value": ""
		},
		{
			"key": "organization_id",
			"value": ""
		},
		{
			"key": "locationId",
			"value": ""
		},
		{
			"key": "patientId",
			"value": ""
		},
		{
			"key": "bundleId",
			"value": ""
		},
		{
			"key": "StatusUrl",
			"value": ""
		}
	]
}